package borge.web.teamspirit.client.page.team.widgets;

import java.util.ArrayList;
import java.util.List;

import borge.web.teamspirit.client.TeamSpirit;
import borge.web.teamspirit.client.TeamSpiritConstants;
import borge.web.teamspirit.client.interfaces.PersistentData;
import borge.web.teamspirit.client.interfaces.WidgetEventHandler;
import borge.web.teamspirit.client.page.shared.widgets.ShowDataWidget;

import com.google.gwt.user.client.ui.DecoratedTabPanel;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.VerticalPanel;

public abstract class ShowTabbedDataWidget extends ShowDataWidget {

    //protected FlexTable iTable;
    protected DecoratedTabPanel iPanel;
    protected List<VerticalPanel> iTabPanels;
    protected List<FlexTable> iTabTables;
    //protected List<String> iTabTitles;
    
    protected TeamSpiritConstants iConstants;
    
    public ShowTabbedDataWidget(WidgetEventHandler aEventHandler, String[] aTabTitles){
        super(aEventHandler);
        
        iConstants = TeamSpirit.getConstants();
        //iTable = new FlexTable()
        iPanel = new DecoratedTabPanel();
        iPanel.setAnimationEnabled(true);
        iTabPanels = new ArrayList<VerticalPanel>();
        iTabTables = new ArrayList<FlexTable>();
        //iTabTitles = new ArrayList<String>();
        
        for(int i = 0; i < aTabTitles.length; ++i){
        	
        	VerticalPanel vp = new VerticalPanel();
        	FlexTable ft = new FlexTable();
        	vp.add(ft);
        	iTabPanels.add(vp);
        	iTabTables.add(ft);
        	iPanel.add(vp, aTabTitles[i]);
        	
        }
        
    }
}
